module Ramaze
    module Helper
        module CoreFunctions

            TAGS = {
                "\n" => '<br/>',
                '[b]' => '<b>', '[/b]' => '</b>',
                '[i]' => '<i>', '[/i]' => '</i>',
                '[u]' => '<p style="text-decoration:underline;display:inline;margin:0">', '[/u]' => '</p>',
                '[gray]' => '<p style="color:gray">', '[gray]' => '</p>'
            }

            def tag2html(text)
                TAGS.each do |key, value|
                    text = text.gsub(key, value)
                end
                text
            end

        end
    end
end
